package com.example.agriculyural.Command;

import com.example.agriculyural.FactoryMethod.AgriculturalMachine;

public class StartMachineCommand implements Command{
    private AgriculturalMachine machine;

    public StartMachineCommand(AgriculturalMachine machine) {
        this.machine = machine;
    }

    @Override
    public void execute() {
        System.out.println("执行启动命令: " + machine.getMachineType() + " " + machine.getId());
        machine.performOperation();
    }

    @Override
    public void undo() {
        System.out.println("撤销启动命令: " + machine.getMachineType() + " " + machine.getId() + " 停止工作");
    }
}
